<template>
  <view class="page">
    <view class="body">
      <Sub-title :label="holiday.title" size="36rpx" />
      <u-text
        :text="`发布时间：${holiday.create_time}`"
        size="24rpx"
        color="#BABABA"
        margin="20rpx 0 40rpx 0"
      />
      <u-parse :content="holiday.content" />
      <u-text :text="`地址：${holiday.address || '-'}`" line-height="40" />
      <u-text
        @click="handleCall"
        :text="`联系我们：${holiday.contact_us || '暂无'}`"
        align="right"
        line-height="40"
      />
    </view>
  </view>
</template>

<script>
import { homeBannerDetail } from "@/request/homeApi.js";
export default {
  data() {
    return {
      holiday: {}, // 园区节庆
    };
  },
  onLoad(e) {
    this.getData(e.id);
  },
  methods: {
    // 获取详情
    getData(id) {
      homeBannerDetail({ id }).then((res) => {
        if (res.code == 1) {
          this.holiday = res.data;
        }
      });
    },
    // 联系我们
    handleCall() {
      if (!this.holiday.contact_us) return;
      uni.makePhoneCall({
        phoneNumber: this.holiday.contact_us,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  padding: 20rpx;
  .end {
    display: flex;
    justify-content: flex-end;
  }
}
</style>
